package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "merchant-enter-apply-api")
public interface TbMerchantEnterApplyApi {

    // 商家审核商户个数
    @GetMapping("/member/merchantEntryApply/getAuditCount")
    Result<Integer> getAuditCount(@RequestParam("businessId") Long businessId);

    // 商户入驻审核列表
    @GetMapping("/member/merchantEntryApply/pageAppMerchantEnterApply")
    Result<Page<AppMerchantEnterApplyPageVo>> pageAppMerchantEnterApply(@SpringQueryMap AppMerchantEnterApplyPageDto appMerchantEnterApplyPageDto);

    // 管理后台：商户入驻审核列表
    @GetMapping("/member/merchantEntryApply/pageAdminMerchantEnterApply")
    Result<Page<AdminMerchantEnterApplyPageVo>> pageAdminMerchantEnterApply(@SpringQueryMap MerchantEnterApplyPageDto merchantEnterApplyPageDto);

    // 商户入驻详情
    @GetMapping("/member/merchantEntryApply/details")
    Result<AppMerchantEnterApplyPageVo> details(@RequestParam("id") Long id);

    // 商户入驻审核
    @PostMapping("/member/merchantEntryApply/audit")
    Result<Boolean> audit(@RequestBody MerchantEnterAuditDto merchantEnterAuditDto);

    // 商家入驻申请
    @PostMapping("/member/merchantEntryApply/apply")
    Result<Boolean> apply(@RequestBody MerchantEnterApplyDto merchantEnterApplyDto);

    // 商户入驻预申请（供用户点击入驻申请链接调用）
    @PostMapping("/member/merchantEntryApply/preApply")
    Result<PreApplyMerchantVo> preApply(@RequestBody PreApplyMerchantDto preApplyMerchantDto);

    // 商户入驻申请新的商家（已经入驻成功，登录后调用）
    @PostMapping("/member/merchantEntryApply/repeatApply")
    Result<Boolean> repeatApply(@RequestBody MerchantEnterRepeatApplyDto merchantEnterRepeatApplyDto);

    // 根据hfApplyNo+hfMerchantNo查询商户入驻列表
    @GetMapping("/member/merchantEntryApply/listByApplyNoAndHfId")
    Result<List<MerchantEnterApplyPageVo>> listByApplyNoAndHfId(@RequestParam("hfApplyNo") String hfApplyNo, @RequestParam("hfMerchantNo") String hfMerchantNo);

    // 更新商户入驻信息
    @PutMapping("/member/merchantEntryApply/updateMerchantEnterApplyById")
    Result<Boolean> updateMerchantEnterApplyById(@RequestBody MerchantEnterApplyUpdateDto merchantEnterApplyUpdateDto);

    // 商户入驻成功处理商户账号和绑定处理
    @PostMapping("/member/merchantEntryApply/enterSuccess")
    Result<Boolean> enterSuccess(@RequestParam("id") Long id);

    // 根据openid获取商户入驻数据
    @GetMapping("/member/merchantEntryApply/getEnterInfoByOpenid")
    Result<MerchantEnterApplyVo> getEnterInfoByOpenid(@RequestParam("openid") String openid);

    // 根据openid获取商户入驻成功数据
    @GetMapping("/member/merchantEntryApply/getSuccessEnterInfoByOpenid")
    Result<MerchantEnterApplyVo> getSuccessEnterInfoByOpenid(@RequestParam("openid") String openid);
}
